package com.kmfc.common.pojo.utils;

public enum StatusCode {

    // 成功相关状态码
    OK(200, "成功"),
    CREATED(201, "失败"),
    ACCEPTED(202, "请求已接受，正在处理"),

    // 客户端错误相关状态码
    BAD_REQUEST(400, "客户端请求语法错误等"),
    UNAUTHORIZED(401, "未授权，需要认证"),
    FORBIDDEN(403, "禁止访问，权限不足"),
    NOT_FOUND(404, "请求的资源未找到"),

    // 服务器端错误相关状态码
    INTERNAL_SERVER_ERROR(500, "服务器内部错误"),
    BAD_GATEWAY(502, "网关错误，上游服务器响应无效"),
    SERVICE_UNAVAILABLE(503, "服务暂时不可用");

    private final int code;
    private final String msg;

     StatusCode(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public int getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }
}
